package com.a.lib_route.home

import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.launcher.ARouter
import com.a.lib_bean.enums.PermissionType

object HomeRouter {
    const val SELECT_ITEM_PATH = "com.a.wmhouse."
    const val GROUP = "home"

    // ========
    // = PATH =
    // ========

    // 模块入口
    const val PATH_MAIN = "/home/home"

    // 对外公开 Fragment
//    const val PATH_SUPPLIER_PROVIDER = "/supplier/provider"

    // ==========
    // = 快捷方法 =
    // ==========
    @JvmStatic
    fun selectItemPath(type: PermissionType): String {
        return SELECT_ITEM_PATH + type + "SelectItem"
    }

    /**
     * 内部传入 [GROUP] 尽量各个模块直接通过对应 [build] 方法跳转
     * 便于代码跳转直观、对外避免跳转错 [GROUP] ( Module )
     */
    internal fun build(path: String): Postcard {
        return ARouter.getInstance().build(path, GROUP)
    }
}